import {Controller, Get, Post, Body, Patch, Param, Delete, HttpCode, HttpStatus} from '@nestjs/common';
import { SysUserService } from './sys_user.service';
import { CreateSysUserDto } from './dto/create-sys_user.dto';
import { UpdateSysUserDto } from './dto/update-sys_user.dto';

@Controller('sys-user')
export class SysUserController {
  constructor(private readonly sysUserService: SysUserService) {}

  @Post()
  @HttpCode(HttpStatus.CREATED)
  create(@Body() createSysUserDto: CreateSysUserDto) {
    return this.sysUserService.create(createSysUserDto);
  }

  @Get()
  findAll() {
    return this.sysUserService.findAll();
  }


  @Get("all-users")
  findAllUserOption() {
    return this.sysUserService.findAllUserOption();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.sysUserService.findOne(id);
  }
  @Get(':id')
  currentUser(@Param('id') id: string) {
    return this.sysUserService.currentUser(id);
  }


  @Patch(':id')
  update(@Param('id') id: string, @Body() updateSysUserDto: UpdateSysUserDto) {
    return this.sysUserService.update(id, updateSysUserDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.sysUserService.remove(id);
  }
}
